#include <modules\system\system_timer.h>

namespace DelGE
{
	namespace Modules
	{
		namespace System
		{
			Win32SystemTimer::Win32SystemTimer()
			{
				this->fStart = this->fEnd = this->fDelta = 0.0f;
			}

			Win32SystemTimer::~Win32SystemTimer()
			{
				this->fStart = this->fEnd = this->fDelta = 0.0f;
			}

			void Win32SystemTimer::Start()
			{
				this->fStart = (float)timeGetTime();
				this->fEnd = 0.0f;
			}

			void Win32SystemTimer::Stop()
			{
				this->fEnd = (float)timeGetTime();
				this->fDelta = this->fEnd - this->fStart;
			}

			void Win32SystemTimer::Restart()
			{
				this->fStart = this->fEnd = this->fDelta = 0.0f;
				this->Start();
			}

			float Win32SystemTimer::GetDeltaTime()
			{
				return this->fDelta;
			}

			float Win32SystemTimer::GetStartTime()
			{
				return this->fStart;
			}

			float Win32SystemTimer::GetEndTime()
			{
				return this->fEnd;
			}

			float Win32SystemTimer::GetCurrentTime()
			{
				return (float)timeGetTime() - this->fStart;
			}
		}
	}
}